﻿//alert("helloo brackets");

/////FUNCTIONS/////
// Anonymous

/*
function(){
    // body
}
*/

// Named Functions
function SayGreeting(Miketyosn) {
    var sentence = Miketyosn + ", Welcome to CoderCamps!";
    alert(sentence);
    AddNums(102, 654)
}
// Call the function
//SayGreeting("RickyBobby");


//
function AddNums(jelly, peanut) {
    var finalNum = jelly + peanut;
    console.log(finalNum);
}
AddNums(2, 2)
AddNums("Hello ", "World")
AddNums("Hello ", 4)





var MyGreeting = function () {
    // alert("hi");
}

MyGreeting();


//// METHODS ////

//var doggy = new Object();

var doggy = {
    isClean: false,
    doWash: function(){ this.isClean = true }
};

//var FirstName = "Ann";
var person = {
    FirstName: "Ricky",
    LastName: "Bobby",
    SayName: function () {
        alert(this.FirstName + " "+this.LastName)
    }
};

////// CONSTRUCTORS //////

var Vehicle = function (Wheels, Speed) {
    this.Wheels = Wheels,
    this.Speed = Speed
};
var car     = new Vehicle(4, 65);
var bike = new Vehicle(2, 25);


///// APPLY & CALL ////

var RootNum = 10;

// add X to RootNum
function AddRoot(numToAdd){
    return this.RootNum + numToAdd;
}
var finalNumber = AddRoot(3);

//
var addFifty = { RootNum: 50 }

var finalResult = AddRoot.call(addFifty, 100);


